package com.ruoyi.truth.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.truth.mapper.QuanMapper;
import com.ruoyi.truth.domain.Quan;
import com.ruoyi.truth.service.IQuanService;

/**
 * 定量信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-05
 */
@Service
public class QuanServiceImpl implements IQuanService 
{
    @Autowired
    private QuanMapper quanMapper;

    /**
     * 查询定量信息
     * 
     * @param quanId 定量信息主键
     * @return 定量信息
     */
    @Override
    public Quan selectQuanByQuanId(Long quanId)
    {
        return quanMapper.selectQuanByQuanId(quanId);
    }

    /**
     * 查询定量信息列表
     * 
     * @param quan 定量信息
     * @return 定量信息
     */
    @Override
    public List<Quan> selectQuanList(Quan quan)
    {
        return quanMapper.selectQuanList(quan);
    }

    /**
     * 新增定量信息
     * 
     * @param quan 定量信息
     * @return 结果
     */
    @Override
    public int insertQuan(Quan quan)
    {
        quan.setCreateTime(DateUtils.getNowDate());
        return quanMapper.insertQuan(quan);
    }

    /**
     * 修改定量信息
     * 
     * @param quan 定量信息
     * @return 结果
     */
    @Override
    public int updateQuan(Quan quan)
    {
        quan.setUpdateTime(DateUtils.getNowDate());
        return quanMapper.updateQuan(quan);
    }

    /**
     * 批量删除定量信息
     * 
     * @param quanIds 需要删除的定量信息主键
     * @return 结果
     */
    @Override
    public int deleteQuanByQuanIds(Long[] quanIds)
    {
        return quanMapper.deleteQuanByQuanIds(quanIds);
    }

    /**
     * 删除定量信息信息
     * 
     * @param quanId 定量信息主键
     * @return 结果
     */
    @Override
    public int deleteQuanByQuanId(Long quanId)
    {
        return quanMapper.deleteQuanByQuanId(quanId);
    }
}
